"""
@Time: 2021/1/15 上午 10:56
@Author: jinzhuan
@File: framenet.py
@Desc: 
"""
from cognlp.io.processor.fn.framenet import FrameNetProcessor
from cognlp.io.loader.fn.framenet import FrameNetLoader
from cognlp import Vocabulary

loader = FrameNetLoader()
data = loader._load('../../../../cognlp/data/fn/framenet/data/train.bios')
frame_vocabulary = Vocabulary()
frame_vocabulary.add_word_lst(loader.get_frame_labels())
frame_vocabulary.build_vocab()
frame_vocabulary.save('../../../../cognlp/data/fn/framenet/data/frame_vocabulary.txt')

element_vocabulary = Vocabulary()
element_vocabulary.add_word_lst(loader.get_element_labels())
element_vocabulary.build_vocab()
element_vocabulary.save('../../../../cognlp/data/fn/framenet/data/element_vocabulary.txt')
processor = FrameNetProcessor(frame_path='../../../../cognlp/data/fn/framenet/data/frame_vocabulary.txt',
                              element_path='../../../../cognlp/data/fn/framenet/data/element_vocabulary.txt')
datable = processor.process(data)
print(1)
